using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_NonheadacctMap : EntityTypeConfiguration<so_Nonheadacct>
    {
        public so_NonheadacctMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Description, t.kind });

            // Properties
            this.Property(t => t.Account)
                .HasMaxLength(20);

            this.Property(t => t.Description)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Classification)
                .HasMaxLength(31);

            this.Property(t => t.Currrency)
                .HasMaxLength(5);

            this.Property(t => t.Type)
                .HasMaxLength(11);

            this.Property(t => t.Class)
                .HasMaxLength(10);

            this.Property(t => t.Sub_Type)
                .HasMaxLength(31);

            this.Property(t => t.kind)
                .IsRequired()
                .HasMaxLength(9);

            this.Property(t => t.Header)
                .HasMaxLength(20);

            this.Property(t => t.Is_Oposit)
                .HasMaxLength(5);

            this.Property(t => t.Opposite_ccount)
                .HasMaxLength(40);

            // Table & Column Mappings
            this.ToTable("so_Nonheadacct");
            this.Property(t => t.Account).HasColumnName("Account");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.Classification).HasColumnName("Classification");
            this.Property(t => t.Currrency).HasColumnName("Currrency");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Class).HasColumnName("Class");
            this.Property(t => t.Sub_Type).HasColumnName("Sub_Type");
            this.Property(t => t.kind).HasColumnName("kind");
            this.Property(t => t.Header).HasColumnName("Header");
            this.Property(t => t.Is_Oposit).HasColumnName("Is_Oposit");
            this.Property(t => t.Opposite_ccount).HasColumnName("Opposite_ccount");
        }
    }
}
